package com.ruoyi.fire.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fire.mapper.FireCaseMapper;
import com.ruoyi.fire.domain.FireCase;
import com.ruoyi.fire.service.IFireCaseService;

/**
 * 火灾案件Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-13
 */
@Service
public class FireCaseServiceImpl implements IFireCaseService 
{
    @Autowired
    private FireCaseMapper fireCaseMapper;

    /**
     * 查询火灾案件
     * 
     * @param uId 火灾案件主键
     * @return 火灾案件
     */
    @Override
    public FireCase selectFireCaseByUId(Long uId)
    {
        return fireCaseMapper.selectFireCaseByUId(uId);
    }

    /**
     * 查询火灾案件列表
     * 
     * @param fireCase 火灾案件
     * @return 火灾案件
     */
    @Override
    public List<FireCase> selectFireCaseList(FireCase fireCase)
    {
        return fireCaseMapper.selectFireCaseList(fireCase);
    }

    /**
     * 新增火灾案件
     * 
     * @param fireCase 火灾案件
     * @return 结果
     */
    @Override
    public int insertFireCase(FireCase fireCase)
    {
        fireCase.setCreateTime(DateUtils.getNowDate());
        return fireCaseMapper.insertFireCase(fireCase);
    }

    /**
     * 修改火灾案件
     * 
     * @param fireCase 火灾案件
     * @return 结果
     */
    @Override
    public int updateFireCase(FireCase fireCase)
    {
        fireCase.setUpdateTime(DateUtils.getNowDate());
        return fireCaseMapper.updateFireCase(fireCase);
    }

    /**
     * 批量删除火灾案件
     * 
     * @param uIds 需要删除的火灾案件主键
     * @return 结果
     */
    @Override
    public int deleteFireCaseByUIds(Long[] uIds)
    {
        return fireCaseMapper.deleteFireCaseByUIds(uIds);
    }

    /**
     * 删除火灾案件信息
     * 
     * @param uId 火灾案件主键
     * @return 结果
     */
    @Override
    public int deleteFireCaseByUId(Long uId)
    {
        return fireCaseMapper.deleteFireCaseByUId(uId);
    }
}
